package com.qrpcw.careercup;
import java.util.ArrayList;

public class ArrayListTest {

	public static void main(String[] args) {
		ArrayListTest test = new ArrayListTest();
		String[] a = new String[]{"1","2","3"};
		String[] b = new String[]{"a","b","c","d","e"};
		String c = new String("12345678");
		test.merge(a,b);
		isUniqueChars2(c);
		
	}
	public ArrayList<String> merge(String[] a,String[] b){
		ArrayList<String> temp = new ArrayList<String>();
		for(String s:a) temp.add(s);
		for(String s:b) temp.add(s);
		return temp;
	}
	
	public static boolean isUniqueChars2(String str) {
		  boolean[] char_set = new boolean[256];
		  for (int i = 0; i < str.length(); i++) {
		    int val = str.charAt(i);
		    if (char_set[val]) return false;
		    char_set[val] = true;
		  }
		  return true;
	}
}
